// $Id$
package lime.application.preference;

import lime.Activator;

import org.eclipse.jface.preference.ColorFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

public class WorkflowMonitorPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

	public static final String WORKITEM_STATE_DORMANT_COLOR = "workitem.state.dormant.color";
	public static final String WORKITEM_STATE_ACQUIRED_COLOR = "workitem.state.acquired.color";
	public static final String WORKITEM_STATE_FINISHED_COLOR = "workitem.state.finished.color";
	public static final String WORKITEM_STATE_PAUSED_COLOR = "workitem.state.paused.color";
	public static final String WORKITEM_STATE_DPAUSED_COLOR = "workitem.state.dpaused.color";
	public static final String WORKITEM_STATE_APAUSED_COLOR = "workitem.state.apaused.color";
	public static final String WORKITEM_STATE_PPAUSED_COLOR = "workitem.state.ppaused.color";
	public static final String WORKITEM_STATE_FAULTED_COLOR = "workitem.state.faulted.color";

	public WorkflowMonitorPreferencePage() {
		super(GRID);
	}
	
	@Override
	protected void createFieldEditors() {
	
		ColorFieldEditor stateDormantColor = new ColorFieldEditor(WORKITEM_STATE_DORMANT_COLOR, "Workitem in state dormant (0)", getFieldEditorParent()); 
		addField(stateDormantColor);
	
		ColorFieldEditor stateAcquiredColor = new ColorFieldEditor(WORKITEM_STATE_ACQUIRED_COLOR, "Workitem in state acquired (1)", getFieldEditorParent()); 
		addField(stateAcquiredColor);
		
		ColorFieldEditor stateFinishedColor = new ColorFieldEditor(WORKITEM_STATE_FINISHED_COLOR, "Workitem in state finished (2)", getFieldEditorParent()); 
		addField(stateFinishedColor);

		ColorFieldEditor statePausedColor = new ColorFieldEditor(WORKITEM_STATE_PAUSED_COLOR, "Workitem in state paused (3)", getFieldEditorParent()); 
		addField(statePausedColor);

		ColorFieldEditor stateDPausedColor = new ColorFieldEditor(WORKITEM_STATE_DPAUSED_COLOR, "Workitem in state dpaused (4)", getFieldEditorParent()); 
		addField(stateDPausedColor);

		ColorFieldEditor stateAPausedColor = new ColorFieldEditor(WORKITEM_STATE_APAUSED_COLOR, "Workitem in state apaused (5)", getFieldEditorParent()); 
		addField(stateAPausedColor);

		ColorFieldEditor statePPausedColor = new ColorFieldEditor(WORKITEM_STATE_PPAUSED_COLOR, "Workitem in state ppaused (6)", getFieldEditorParent()); 
		addField(statePPausedColor);

		ColorFieldEditor stateFaultedColor = new ColorFieldEditor(WORKITEM_STATE_FAULTED_COLOR, "Workitem in state faulted (7)", getFieldEditorParent()); 
		addField(stateFaultedColor);		
	}

	@Override
	public void init(IWorkbench workbench) {
		setPreferenceStore(Activator.getDefault().getPreferenceStore());
	}

}